/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.misena.praxispraktik.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author TADSI12
 */
@Entity
@Table(name = "jefes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Jefes.findAll", query = "SELECT j FROM Jefes j"),
    @NamedQuery(name = "Jefes.findByIdJefes", query = "SELECT j FROM Jefes j WHERE j.idJefes = :idJefes")})
public class Jefes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idJefes")
    private Integer idJefes;
    @JoinColumn(name = "idPersonas", referencedColumnName = "idPersonas")
    @ManyToOne(optional = false)
    private Personas idPersonas;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idJefes")
    private Collection<Practicas> practicasCollection;

    public Jefes() {
    }

    public Jefes(Integer idJefes) {
        this.idJefes = idJefes;
    }

    public Integer getIdJefes() {
        return idJefes;
    }

    public void setIdJefes(Integer idJefes) {
        this.idJefes = idJefes;
    }

    public Personas getIdPersonas() {
        return idPersonas;
    }

    public void setIdPersonas(Personas idPersonas) {
        this.idPersonas = idPersonas;
    }

    @XmlTransient
    public Collection<Practicas> getPracticasCollection() {
        return practicasCollection;
    }

    public void setPracticasCollection(Collection<Practicas> practicasCollection) {
        this.practicasCollection = practicasCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idJefes != null ? idJefes.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Jefes)) {
            return false;
        }
        Jefes other = (Jefes) object;
        if ((this.idJefes == null && other.idJefes != null) || (this.idJefes != null && !this.idJefes.equals(other.idJefes))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.misena.praxispraktik.entity.Jefes[ idJefes=" + idJefes + " ]";
    }
    
}
